#pragma once
#include<iostream>

using namespace std;

/*
class A
{
public:
	static A* instance()	//三、共有的获取实例的静态方法
	{
		if (m_instance == NULL)
		{
			m_instance = new A();
		}
		return m_instance;
	}	

	void show()
	{
		cout << "name = " << m_name << endl;
	}

private:
	A() :m_name("张三") {};	//一、构造函数设为私有
	A(const A&);			//禁用拷贝构造函数
	~A();
	A& operator = (const A&);	//禁用赋值构造函数
	
private:
	string m_name;
	static A* m_instance;	//二、私有的静态实例


};

A* A::m_instance = NULL;
*/


#include "template.h"
using namespace yazi::utility;

class A
{
	friend class Singleton<A>;	//友元，
public:
	void show()
	{
		cout << "name = " << m_name << endl;
	}

private:
	A() :m_name("张三") {};	//一、构造函数设为私有
	A(const A&) {}			//禁用拷贝构造函数
	~A() {}
	A& operator = (const A&);	//禁用赋值构造函数

private:
	string m_name;
};












